package org.afs.gescol.core.model.data;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.afs.gescol.core.model.references.Cycle;
import org.afs.gescol.core.model.references.Level;
import org.afs.gescol.core.model.references.Series;
import org.hibernate.annotations.ForeignKey;
import org.scub.foundation.framework.core.model.BaseModel;

/**
 * Data model for school class.
 * @autor Kobla GBENYO (kobla.gbenyo@gmail.com)
 */
@Entity
@Table(name = "data_class")
@AttributeOverrides({@AttributeOverride(name = "id", column = @Column(name = "class_id", nullable = false)),
    @AttributeOverride(name = "version", column = @Column(name = "class_version", nullable = false, unique = false)),
})
public class SchoolClass extends BaseModel {

    /** Serial Version UID. */
    private static final long serialVersionUID = 987728315542043920L;

    /** School Class Short label. */
    @Column(name = "class_short_label")
    private String shortLabel;

    /** School Class Long label. */
    @Column(name = "class_long_label")
    private String longLabel;

    @ManyToOne
    @JoinColumn(name = "cycle_id")
    @ForeignKey(name = "fk_data_class_ref_cycle_id")
    private Cycle classCycle;

    @ManyToOne
    @JoinColumn(name = "level_id")
    @ForeignKey(name = "fk_data_class_ref_level_id")
    private Level classLevel;

    @ManyToOne
    @JoinColumn(name = "series_id")
    @ForeignKey(name = "fk_data_class_ref_series_id")
    private Series classSeries;

    /**
     * Get the value of shortLabel.
     * @return the shortLabel
     */
    public String getShortLabel() {
        return shortLabel;
    }

    /**
     * Set the value of shortLabel.
     * @param shortLabel the shortLabel to set
     */
    public void setShortLabel(String shortLabel) {
        this.shortLabel = shortLabel;
    }

    /**
     * Get the value of longLabel.
     * @return the longLabel
     */
    public String getLongLabel() {
        return longLabel;
    }

    /**
     * Set the value of longLabel.
     * @param longLabel the longLabel to set
     */
    public void setLongLabel(String longLabel) {
        this.longLabel = longLabel;
    }

    /**
     * Get the value of classCycle.
     * @return the classCycle
     */
    public Cycle getClassCycle() {
        return classCycle;
    }

    /**
     * Set the value of classCycle.
     * @param classCycle the classCycle to set
     */
    public void setClassCycle(Cycle classCycle) {
        this.classCycle = classCycle;
    }

    /**
     * Get the value of classLevel.
     * @return the classLevel
     */
    public Level getClassLevel() {
        return classLevel;
    }

    /**
     * Set the value of classLevel.
     * @param classLevel the classLevel to set
     */
    public void setClassLevel(Level classLevel) {
        this.classLevel = classLevel;
    }

    /**
     * Get the value of classSeries.
     * @return the classSeries
     */
    public Series getClassSeries() {
        return classSeries;
    }

    /**
     * Set the value of classSeries.
     * @param classSeries the classSeries to set
     */
    public void setClassSeries(Series classSeries) {
        this.classSeries = classSeries;
    }

    @Override
    public boolean equals(Object other) {
        return equalsUtil(other);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

}
